<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<script type="text/javascript">
	function edit4userinfo() {
		var dynamic_dialog = $("<div/>").dialog({
			title : '用户编辑',
			width : 900,
			height : 600,
			closed : false,
			cache : false,
			href : '${ctx}/user/editTo.do?id=${user.id}',
			modal : true,
			resizable : true,
			buttons : [ {
				text : '保存',
				iconCls : 'icon-add',
				handler : function() {
					$.serializeObject($('#userEdit_edit_form'));
					$('#userEdit_edit_form').form('submit', {
						url : '${ctx}/user/edit.do',
						onSubmit : function() {
						},
						success : function(data) {
							var obj = $.parseJSON(data);
							if (obj.success) {
								dynamic_dialog.dialog('close');

							}
							$.messager.show({
								title : '提示',
								msg : obj.msg
							});
						}
					});
				}
			} ],
			onClose : function() {
				$(this).dialog('destroy');
			},
			onLoad : function() {
				$("#userEdit_edit_form").form('load', rows[0]);
			}

		});
	}
</script>

<c:if test="${sessionInfo.username == null}">
	<img
		src="${ctx}/style/images/blue_face/bluefaces_35.png"
		alt="" />
	<div>登录已超时，请重新登录，然后再刷新本功能！</div>
	<script type="text/javascript" charset="utf-8">
		try {
			parent.$.messager.progress('close');
		} catch (e) {
		}
	</script>
</c:if>
<c:if test="${sessionInfo.username != null}">
	<fieldset>

		<legend>个人信息</legend>
		<div align="center">
			<table width="90%" border="1">
				<tr>
					<td colspan="2" rowspan="5" align="center">
						 <c:if test="${not empty user.attpath}">
			              		<img src="${user.attpath}" width="300" height="400" />
			              </c:if>
			              <c:if test="${empty user.attpath}">
			              		<img src="${ctx}/ui/images/userinfo/NoPhoto.jpg" width="300" height="400" />
			              </c:if>
					</td>
					<td><div align="center">
							<strong>姓名</strong>
						</div></td>
					<td><div align="center">${user.name}</div></td>
					<td><div align="center">
							<strong>性别</strong>
						</div></td>
					<td><div align="center">${user.sex}</div></td>
				</tr>
				<tr>
					<td><div align="center">
							<strong>科室</strong>
						</div></td>
					<td><div align="center">${user.organization.text}</div></td>
					<td><div align="center">
							<strong>职务</strong>
						</div></td>
					<td><div align="center">${user.post}</div></td>
				</tr>
				<tr>
					<td><div align="center">
							<strong>座机</strong>
						</div></td>
					<td><div align="center">${user.tel}</div></td>
					<td><div align="center">
							<strong>手机</strong>
						</div></td>
					<td><div align="center">${user.mobile}</div></td>
				</tr>
				<tr>
					<td><div align="center">
							<strong>位置</strong>
						</div></td>
					<td><div align="center">${user.officeloc}</div></td>
					<td><div align="center"></div></td>
					<td><div align="center"></div></td>
				</tr>
				<tr>
					<td colspan="4" rowspan="2"><p>当前状态:在岗</p>
						<p>今日访客：18人 未读留言：12条</p></td>
				</tr>
				<tr>
					<td colspan="2">
						<div align="center">
							<a onclick="edit4userinfo();" class="easyui-linkbutton"
								data-options="iconCls:'icon-add',fit:true">个人信息修改</a>
						</div>
					</td>
				</tr>
			</table>
		</div>
	</fieldset>
</c:if>
